#include <catch2/catch.hpp>

#include "solution.hpp"

TEST_CASE("030_substring_with_concatenation_of_all_words/test.cpp", "[030]") {
    CHECK(Solution().findSubstringSorted("barfoothefoobarman", {"foo","bar"}) == std::vector{0,9});
    CHECK(Solution().findSubstringSorted("wordgoodgoodgoodbestword", {"word","good","best","word"}).empty());
    CHECK(Solution().findSubstringSorted("wordgoodgoodgoodbestword", {"word","good","best","good"}) == std::vector{8});
    CHECK(Solution().findSubstringSorted("barfoofoobarthefoobarman", {"bar","foo","the"}) == std::vector{6,9,12});
    CHECK(Solution().findSubstringSorted("ababababab", {"ababa","babab"}) == std::vector{0});

    CHECK(Solution2().findSubstringSorted("barfoothefoobarman", {"foo","bar"}) == std::vector{0,9});
    CHECK(Solution2().findSubstringSorted("wordgoodgoodgoodbestword", {"word","good","best","word"}).empty());
    CHECK(Solution2().findSubstringSorted("wordgoodgoodgoodbestword", {"word","good","best","good"}) == std::vector{8});
    CHECK(Solution2().findSubstringSorted("barfoofoobarthefoobarman", {"bar","foo","the"}) == std::vector{6,9,12});
    CHECK(Solution2().findSubstringSorted("ababababab", {"ababa","babab"}) == std::vector{0});
}
